<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="time"></div>
    <!-- <input type="button" value="button" id="btn"> -->
    <script>
        // var ele = document.getElementById("btn");
        // ele.addEventListener("click", function () {
        //     Promise.resolve().then(() => console.log("test1"));
        //     console.log("1");
        // })
        // ele.addEventListener("click", function () {
        //     Promise.resolve().then(() => console.log("test2"));
        //     console.log("2");
        // })
        // ele.click();
        let timeDiv = document.getElementById("time");
        function printTime() {
            timeDiv.innerHTML = new Date().toLocaleString();
            window.requestAnimationFrame(printTime);
        }
        window.requestAnimationFrame(printTime);
        
        // Promise.resolve().then(() => {
        //     setTimeout(() => {
        //         while (true) {

        //         }
        //     }, 3000);
        // })

    </script>
</body>

</html>